distance[i-1]= A2B_straight(A,i);
        //printf("%d ",distance[i-1]);
        S[i-1]=false;
        if (i!=A&&distance[i-1]<INT_MAX)path[i-1]=A;
        else path[i-1]=-1;